package com.parsifal.bluetoothdemo.iface;

import android.app.Activity;
import android.bluetooth.BluetoothDevice;
import android.content.Context;

import com.parsifal.bluetoothdemo.listener.OnSocketReceiveListener;
import com.parsifal.bluetoothdemo.listener.OnSocketSendListener;

import java.util.Set;

/**
 * Created by yangming on 17-3-30.
 */
public interface IBluetoothModel {

    int REQUEST_ENABLE_BT = 1;

    /**
     * <p><b>通用</b></p>
     */
    boolean init();

    /**
     * <p><b>通用</b></p>
     */
    void createClient(OnSocketSendListener onSocketSendListener, OnSocketReceiveListener onSocketReceiveListener);

    /**
     * <p><b>通用</b></p>
     */
    void createServer(OnSocketSendListener onSocketSendListener, OnSocketReceiveListener onSocketReceiveListener);

    /**
     * <p><b>客户端方法</b></p>
     */
    void connectServer(BluetoothDevice server);

    /**
     * <p><b>服务端方法</b></p>
     */
    void connectClient(BluetoothDevice client);

    /**
     * <p><b>通用</b></p>
     */
    void removeBond(BluetoothDevice device);

    /**
     * <p><b>客户端方法</b></p>
     */
    void sendToServer(String clientMsg);

    /**
     * <p><b>服务端方法</b></p>
     */
    void stopServer();

    /**
     * <p><b>客户端方法</b></p>
     */
    void stopClient();

    /**
     * <p><b>服务端方法</b></p>
     */
    void closeServerSocket(BluetoothDevice device);

    /**
     * <p><b>通用</b></p>
     */
    boolean isEnabled();

    /**
     * <p><b>通用</b></p>
     */
    void open(Activity activity);

    /**
     * <p><b>通用</b></p>
     */
    Set<BluetoothDevice> getBondedDevices();

    /**
     * <p><b>通用</b></p>
     */
    void scan();

    /**
     * <p><b>通用</b></p>
     */
    void ensureDiscoverable(Context context);

    /**
     * <p><b>通用</b></p>
     */
    void disable();
}
